#include<iostream>
#include"../Card.h"
using namespace std;

bool passTest(Card card1,Card card2, Card card3, Card card4, Card card5, Card card6){

Card someCard1 = card1;
Card someCard2 = card2;
Card someCard3 = card3;
Card someCard4 = card4;
Card someCard5 = card5;
Card someCard6 = card6;

if(someCard1.getRank() != 2) return false;

if(someCard2.getRank() != 1) return false;

if(someCard1.getSuit() != 0) return false;

if(someCard2.getSuit() != 1) return false;

if(someCard1.getID() != 1) return false;

if(someCard2.getID() != 2) return false;

if(someCard1.compareCard(someCard2) != 1) return false;

if(someCard3.compareCard(someCard4) != 0) return false;

if(someCard5.compareCard(someCard6) != -1) return false;

return true;

}


int main(){
  Card someCard1(diamonds, ace, 1);
  Card someCard2(hearts, ace, 2);

  /*test getRank()*/
  cout<< "Getting test card's rank: ";
  cout<< someCard1.getRank() <<endl;
  cout<< "expected: 2"<<endl;
  /*test getSuit()*/
  cout<< "Getting test card's suit: ";
  cout<< someCard1.getSuit() <<endl; 
  cout<< "expected: 0 for diamonds"<<endl;
  /*test getID()*/
  cout<< "Getting test card's ID: ";
  cout<< someCard1.getID() <<endl;
  cout<< "expected 1"<<endl;
  /*test compareCard() cases*/
  cout<< "Comparing rank 1 to rank ace: "<<endl;
  cout<< someCard1.compareCard(someCard2)<<endl;
  cout<< "expected 1"<<endl;
  
  Card someCard3(hearts, _5, 3);
  Card someCard4(spades, _5, 4);
  cout<< "Comparing rank 5 to rank 5: "<<endl;
  cout<< someCard3.compareCard(someCard4)<<endl;
  cout<< "expected 0"<<endl;

  Card someCard5(clubs, _10, 5);
  Card someCard6(clubs, queen, 6);
  cout<< "Comparing rank 10 to rank Queen: "<<endl;
  cout<< someCard5.compareCard(someCard6)<<endl;
  cout<< "expected -1"<<endl;
  
  cout<< "Did it pass all tests?"<<endl;
  
  cout<<"Card Test done" <<endl;
  
  string testpassed;
  
  if(passTest(someCard1, someCard2, someCard3, someCard4, someCard5, someCard6))
  {
  	testpassed = "yes";
  }
  else
  {
  	testpassed = "no";
  }

  cout<< "Did it pass all tests?"<<endl;
  cout<<testpassed<<endl;

  return 0;
}
